var param = {}, formId = 'queryForm', url = "/openx/order/queryService/listVoiceMsgRecord";



//初始化时间
layui.use('laydate', function () {
    
     var laydate = layui.laydate;
     document.getElementById('startTime').value = laydate.now() + ' 00:00:00';
     document.getElementById('endTime').value = laydate.now() + ' 23:59:59';
 
     var data = $.openx.getJsonObj(formId);
     param.voice = data;
     $.openx.initTable("table", url, param);
 });
 

//查询按钮触发
$.openx.query = function () {
    var data = $.openx.getJsonObj(formId);
    param.voice = data;
    $.openx.tableRefresh(url, param);
}

//格式化下单时间
function createTimeFormat(value, row) {
    return $.openx.formatDate(new Date(value));
}

function resetForm(){
    $('#queryForm')[0].reset();
    var laydate = layui.laydate;
    console.log(laydate.now().split(' ')[0]);
    document.getElementById('startTime').value = laydate.now().split(' ')[0] + ' 00:00:00';
    document.getElementById('endTime').value = laydate.now().split(' ')[0] + ' 23:59:59';

    var data = $.openx.getJsonObj(formId);
    param.voice = data;
    $.openx.initTable("table", url, param);
    $.openx.query();
}